package com.training.content.service.impl;

import java.util.List;
import com.training.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.training.content.mapper.IndustryTypeMapper;
import com.training.content.domain.IndustryType;
import com.training.content.service.IIndustryTypeService;

/**
 * 行业信息Service业务层处理
 * 
 * @author training
 * @date 2021-10-25
 */
@Service
public class IndustryTypeServiceImpl implements IIndustryTypeService 
{
    @Autowired
    private IndustryTypeMapper industryTypeMapper;

    /**
     * 查询行业信息
     * 
     * @param industryId 行业信息主键
     * @return 行业信息
     */
    @Override
    public IndustryType selectIndustryTypeByIndustryId(Long industryId)
    {
        return industryTypeMapper.selectIndustryTypeByIndustryId(industryId);
    }

    /**
     * 查询行业信息列表
     * 
     * @param industryType 行业信息
     * @return 行业信息
     */
    @Override
    public List<IndustryType> selectIndustryTypeList(IndustryType industryType)
    {
        return industryTypeMapper.selectIndustryTypeList(industryType);
    }

    /**
     * 新增行业信息
     * 
     * @param industryType 行业信息
     * @return 结果
     */
    @Override
    public int insertIndustryType(IndustryType industryType)
    {
        industryType.setCreateTime(DateUtils.getNowDate());
        return industryTypeMapper.insertIndustryType(industryType);
    }

    /**
     * 修改行业信息
     * 
     * @param industryType 行业信息
     * @return 结果
     */
    @Override
    public int updateIndustryType(IndustryType industryType)
    {
        industryType.setUpdateTime(DateUtils.getNowDate());
        return industryTypeMapper.updateIndustryType(industryType);
    }

    /**
     * 批量删除行业信息
     * 
     * @param industryIds 需要删除的行业信息主键
     * @return 结果
     */
    @Override
    public int deleteIndustryTypeByIndustryIds(Long[] industryIds)
    {
        return industryTypeMapper.deleteIndustryTypeByIndustryIds(industryIds);
    }

    /**
     * 删除行业信息信息
     * 
     * @param industryId 行业信息主键
     * @return 结果
     */
    @Override
    public int deleteIndustryTypeByIndustryId(Long industryId)
    {
        return industryTypeMapper.deleteIndustryTypeByIndustryId(industryId);
    }
}
